/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package RedBlackTree;

/**
 *
 * @author nknowles
 */
public class TNode<T> {

  private TNode<T> left, right;
  private T value;
  private String color;
  private int height;

  public TNode() {
    this.left = null;
    this.right = null;
    this.value = null;
    this.color = "B";
    this.height = 0;
  }

  public TNode(T value) {
    this.left = null;
    this.right = null;
    this.value = value;
    this.color = "B";
    this.height = 0;
  }

  public TNode(TNode left, TNode right, T value) {
    this.left = left;
    this.right = right;
    this.value = value;
    this.color = "B";
    this.height = 0;
  }

  public TNode getLeft() {
    return left;
  }

  public void setLeft(TNode left) {
    this.left = left;
  }

  public TNode getRight() {
    return right;
  }

  public void setRight(TNode right) {
    this.right = right;
  }

  public T getValue() {
    return value;
  }

  public void setValue(T value) {
    this.value = value;
  }

  public String getColor() {
    return color;
  }

  public void setColor(String color) {
    this.color = color;
  }

  public int getHeight() {
    return height;
  }

  public void setHeight(int height) {
    this.height = height;
  }

  @Override
  public String toString() {
    return "TNode{" + "left=" + left + ", right=" + right + ", value=" + value + '}';
  }
}
